// import Router from 'koa-router';
// import axios from './utils/axios'
// //import Province from '../dbs/models/province'

// let router = new Router({prefix: '/geo'})

// const key = '4VIBZ-5EVE4-VP4UR-DST4G-EURJT-MSB5L';

// router.get('/getPosition', async (ctx) => {
//   let {
//     status,
//     data:{
//         province,
//         city
//     }
//   } = await axios.get(`https://apis.map.qq.com/ws/location/v1/ip&key=${key}`)
//   if (status === 200) {
//     ctx.body = {
//       province,
//       city
//     }
//   } else {
//     ctx.body = {
//       province: '',
//       city: ''
//     }
//   }
// })


// export default router;



//import request from '@/utils/request'
import request from '../utils/apiRequest'

const key = '4VIBZ-5EVE4-VP4UR-DST4G-EURJT-MSB5L';

export function getPosition() {
  return request({
    url: 'api/ws/location/v1/ip?key=' + key,
    method: 'get'
  })
}
